﻿using System;
using System.Collections.Generic;
using KKSG;
using ProtoBuf;
using UnityEngine;
using XUpdater;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x02000ED6 RID: 3798
	internal sealed class XScene : XSingleton<XScene>
	{
		// Token: 0x0600C904 RID: 51460 RVA: 0x002D1204 File Offset: 0x002CF404
		public override bool Init()
		{
			this._loader = XUpdater.XUpdater.XGameRoot.AddComponent<XSceneLoader>();
			this._transfer = XUpdater.XUpdater.XGameRoot.AddComponent<XSceneTransfer>();
			return true;
		}

		// Token: 0x0600C905 RID: 51461 RVA: 0x002D1237 File Offset: 0x002CF437
		public override void Uninit()
		{
			this._loader = null;
			this._transfer = null;
		}

		// Token: 0x17003508 RID: 13576
		// (get) Token: 0x0600C906 RID: 51462 RVA: 0x002D1248 File Offset: 0x002CF448
		public bool bSpectator
		{
			get
			{
				return this._bIsSpectator;
			}
		}

		// Token: 0x17003509 RID: 13577
		// (get) Token: 0x0600C907 RID: 51463 RVA: 0x002D1260 File Offset: 0x002CF460
		public bool FilterFx
		{
			get
			{
				return !this._bIsSpectator && XFxMgr.FilterFarFx && XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.World;
			}
		}

		// Token: 0x1700350A RID: 13578
		// (get) Token: 0x0600C908 RID: 51464 RVA: 0x002D1298 File Offset: 0x002CF498
		public bool SceneReady
		{
			get
			{
				return this._bSceneEntered;
			}
		}

		// Token: 0x1700350B RID: 13579
		// (get) Token: 0x0600C909 RID: 51465 RVA: 0x002D12B0 File Offset: 0x002CF4B0
		// (set) Token: 0x0600C90A RID: 51466 RVA: 0x002D12C8 File Offset: 0x002CF4C8
		public bool SceneStarted
		{
			get
			{
				return this._bStarted;
			}
			set
			{
				if (this._bStarted != value)
				{
					this._bStarted = value;
					if (this._bStarted)
					{
						this.OnSceneStarted();
					}
				}
			}
		}

		// Token: 0x1700350C RID: 13580
		// (get) Token: 0x0600C90B RID: 51467 RVA: 0x002D1300 File Offset: 0x002CF500
		// (set) Token: 0x0600C90C RID: 51468 RVA: 0x002D1318 File Offset: 0x002CF518
		public XEntity Dirver
		{
			get
			{
				return this._story_dirver;
			}
			set
			{
				this._story_dirver = value;
			}
		}

		// Token: 0x1700350D RID: 13581
		// (get) Token: 0x0600C90D RID: 51469 RVA: 0x002D1322 File Offset: 0x002CF522
		// (set) Token: 0x0600C90E RID: 51470 RVA: 0x002D132A File Offset: 0x002CF52A
		public Camera AssociatedCamera { get; set; }

		// Token: 0x1700350E RID: 13582
		// (get) Token: 0x0600C90F RID: 51471 RVA: 0x002D1334 File Offset: 0x002CF534
		// (set) Token: 0x0600C910 RID: 51472 RVA: 0x002D1363 File Offset: 0x002CF563
		public bool IsMustTransform
		{
			get
			{
				return this._scene_type == SceneType.SCENE_MOBA || this._scene_type == SceneType.SCENE_HEROBATTLE || this.m_IsMustTransform;
			}
			set
			{
				this.m_IsMustTransform = value;
			}
		}

		// Token: 0x1700350F RID: 13583
		// (get) Token: 0x0600C911 RID: 51473 RVA: 0x002D1370 File Offset: 0x002CF570
		public bool IsMobaScene
		{
			get
			{
				return this._scene_type == SceneType.SCENE_MOBA || this._scene_type == SceneType.SCENE_HEROBATTLE;
			}
		}

		// Token: 0x17003510 RID: 13584
		// (get) Token: 0x0600C912 RID: 51474 RVA: 0x002D139C File Offset: 0x002CF59C
		public bool CanFadeOnCreate
		{
			get
			{
				return this._scene_type != SceneType.SCENE_MOBA && this._scene_type != SceneType.SCENE_HEROBATTLE;
			}
		}

		// Token: 0x17003511 RID: 13585
		// (get) Token: 0x0600C913 RID: 51475 RVA: 0x002D13C8 File Offset: 0x002CF5C8
		// (set) Token: 0x0600C914 RID: 51476 RVA: 0x002D13D0 File Offset: 0x002CF5D0
		public bool IsViewGridScene { get; set; }

		// Token: 0x17003512 RID: 13586
		// (get) Token: 0x0600C915 RID: 51477 RVA: 0x002D13DC File Offset: 0x002CF5DC
		public SceneType SceneType
		{
			get
			{
				return this._scene_type;
			}
		}

		// Token: 0x17003513 RID: 13587
		// (get) Token: 0x0600C916 RID: 51478 RVA: 0x002D13F4 File Offset: 0x002CF5F4
		public uint SceneID
		{
			get
			{
				return this._scene_id;
			}
		}

		// Token: 0x17003514 RID: 13588
		// (get) Token: 0x0600C917 RID: 51479 RVA: 0x002D140C File Offset: 0x002CF60C
		public SceneTable.RowData SceneData
		{
			get
			{
				return this._scene_data;
			}
		}

		// Token: 0x17003515 RID: 13589
		// (get) Token: 0x0600C918 RID: 51480 RVA: 0x002D1424 File Offset: 0x002CF624
		public XCameraEx GameCamera
		{
			get
			{
				return this._camera;
			}
		}

		// Token: 0x17003516 RID: 13590
		// (get) Token: 0x0600C919 RID: 51481 RVA: 0x002D143C File Offset: 0x002CF63C
		public bool IsPVPScene
		{
			get
			{
				return this.SceneData == null || this.SceneData.CombatType == 1;
			}
		}

		// Token: 0x17003517 RID: 13591
		// (get) Token: 0x0600C91A RID: 51482 RVA: 0x002D1470 File Offset: 0x002CF670
		// (set) Token: 0x0600C91B RID: 51483 RVA: 0x002D1488 File Offset: 0x002CF688
		public Terrain CurrentTerrain
		{
			get
			{
				return this._terrain;
			}
			set
			{
				this._terrain = value;
			}
		}

		// Token: 0x17003518 RID: 13592
		// (get) Token: 0x0600C91C RID: 51484 RVA: 0x002D1494 File Offset: 0x002CF694
		public SceneCfg SceneEntranceConfig
		{
			get
			{
				return this._scene_cfg;
			}
		}

		// Token: 0x17003519 RID: 13593
		// (get) Token: 0x0600C91D RID: 51485 RVA: 0x002D14AC File Offset: 0x002CF6AC
		// (set) Token: 0x0600C91E RID: 51486 RVA: 0x002D14C4 File Offset: 0x002CF6C4
		public ErrorCode Error
		{
			get
			{
				return this._error;
			}
			set
			{
				this._error = value;
			}
		}

		// Token: 0x1700351A RID: 13594
		// (get) Token: 0x0600C91F RID: 51487 RVA: 0x002D14D0 File Offset: 0x002CF6D0
		// (set) Token: 0x0600C920 RID: 51488 RVA: 0x002D14E8 File Offset: 0x002CF6E8
		public string ErrorAddtional
		{
			get
			{
				return this._error_addtional;
			}
			set
			{
				this._error_addtional = value;
			}
		}

		// Token: 0x0600C921 RID: 51489 RVA: 0x002D14F4 File Offset: 0x002CF6F4
		public bool TryGetTerrainY(Vector3 pos, out float y)
		{
			return XCurrentGrid.grid.TryGetHeight(pos, out y);
		}

		// Token: 0x0600C922 RID: 51490 RVA: 0x002D1514 File Offset: 0x002CF714
		public bool IsWalkable(Vector3 pos)
		{
			float num = 0f;
			return XCurrentGrid.grid.TryGetHeight(pos, out num) && num >= 0f;
		}

		// Token: 0x0600C923 RID: 51491 RVA: 0x002D154C File Offset: 0x002CF74C
		public bool IsWalkable(Vector3 pos, out float y)
		{
			if (XCurrentGrid.grid.TryGetHeight(pos, out y))
			{
				if (y >= 0f)
				{
					if (this._terrain != null)
					{
						float num = this._terrain.SampleHeight(pos);
						if (y - num < 0.05f)
						{
							y = num;
						}
						return true;
					}
				}
			}
			return false;
		}

		// Token: 0x0600C924 RID: 51492 RVA: 0x002D15BC File Offset: 0x002CF7BC
		public float TerrainY(Vector3 pos)
		{
			float num = 0f;
			//bool flag = this._terrain != null;
			if (this._terrain != null)
			{
				num = this._terrain.SampleHeight(pos);
			}
			//bool flag2 = XCurrentGrid.grid != null;
			if (XCurrentGrid.grid != null)
			{
				float height = XCurrentGrid.grid.GetHeight(pos);
				//bool flag3 = height - num > 0.05f;
				if (height - num > 0.05f)
				{
					num = height;
				}
			}
			return num;
		}

		// Token: 0x0600C925 RID: 51493 RVA: 0x002D1622 File Offset: 0x002CF822
		public void PauseBGM()
		{
			XSingleton<XAudioMgr>.singleton.PauseBGM();
		}

		// Token: 0x0600C926 RID: 51494 RVA: 0x002D1630 File Offset: 0x002CF830
		public void ResumeBGM()
		{
			XSingleton<XAudioMgr>.singleton.ResumeBGM();
		}

		// Token: 0x0600C927 RID: 51495 RVA: 0x002D1640 File Offset: 0x002CF840
		public bool TurnToTransfer(uint sceneid)
		{
			string unitySceneFile = XSingleton<XSceneMgr>.singleton.GetUnitySceneFile(sceneid);
			return this._scene_file == unitySceneFile;
		}

		// Token: 0x0600C928 RID: 51496 RVA: 0x002D166A File Offset: 0x002CF86A
		public void UntriggerScene()
		{
			this._bSceneEntered = false;
		}

		// Token: 0x0600C929 RID: 51497 RVA: 0x002D1674 File Offset: 0x002CF874
		public void StoreSceneConfig(SceneCfg config)
		{
			this._scene_cfg = Serializer.DeepClone<SceneCfg>(config);
		}

		// Token: 0x0600C92A RID: 51498 RVA: 0x002D1684 File Offset: 0x002CF884
		public void SceneEnterTo(SceneCfg config, bool fromserver = true)
		{
			uint sceneID = config.SceneID;
			SceneType sceneType = XSingleton<XSceneMgr>.singleton.GetSceneType(sceneID);
			this._next_sync_mode = config.SyncMode;
			this._next_is_spectator = config.isWatcher;
			bool isBossRushScene = XSingleton<XSceneMgr>.singleton.GetSceneType(config.SceneID) == SceneType.SCENE_BOSSRUSH;
			if (isBossRushScene)
			{
				XLevelSpawnInfo spawnerBySceneID = XSingleton<XLevelSpawnMgr>.singleton.GetSpawnerBySceneID(config.SceneID);
				XSingleton<XLevelSpawnMgr>.singleton.MonsterIDs.Clear();
				//zcg XBossBushDocument specificDocument = XDocuments.GetSpecificDocument<XBossBushDocument>(XBossBushDocument.uuID);
				//zcg XSingleton<XLevelSpawnMgr>.singleton.MonsterIDs.Add(specificDocument.entityRow.ID);
			}
			else
			{
				XSingleton<XLevelSpawnMgr>.singleton.CacheServerMonsterID(config.preloadEnemyIDs);
			}
			//bool flag2 = config.SyncMode == 2;
			if (config.SyncMode == 2)
			{
				XSingleton<XLevelSpawnMgr>.singleton.CacheServerMonster(config.enemyWaves);
			}
			switch (sceneType)
			{
				case SceneType.SCENE_HALL:
					if (fromserver)
					{
						EXStage stage = XSingleton<XGame>.singleton.CurrentStage.Stage;
						if (stage != EXStage.SelectChar)
						{
							XSingleton<XGame>.singleton.SwitchTo(EXStage.Hall, sceneID);
						}
						else
						{
							XSingleton<XGame>.singleton.CurrentStage.Play();
							this.StoreSceneConfig(config);
						}
					}
					else
					{
						XSingleton<XGame>.singleton.SwitchTo(EXStage.Hall, sceneID);
					}
					goto IL_336;
				case SceneType.SCENE_BATTLE:
					if (fromserver)
					{
						EXStage stage2 = XSingleton<XGame>.singleton.CurrentStage.Stage;
						if (stage2 != EXStage.SelectChar)
						{
							XSingleton<XGame>.singleton.SwitchTo(EXStage.World, sceneID);
						}
						else
						{
							XSingleton<XGame>.singleton.CurrentStage.Play();
							this.StoreSceneConfig(config);
						}
					}
					else
					{
						XSingleton<XGame>.singleton.SwitchTo(EXStage.World, sceneID);
					}
					goto IL_336;
				case SceneType.SCENE_NEST:
				case SceneType.SCENE_ARENA:
				case SceneType.SCENE_WORLDBOSS:
				case SceneType.SCENE_BOSSRUSH:
				case SceneType.SCENE_GUILD_BOSS:
				case SceneType.SCENE_PK:
				case SceneType.SCENE_ABYSSS:
				case SceneType.SCENE_TOWER:
				case SceneType.SCENE_PVP:
				case SceneType.SCENE_DRAGON:
				case SceneType.SCENE_GMF:
				case SceneType.SCENE_GODDESS:
				case SceneType.SCENE_DRAGON_EXP:
				case SceneType.SCENE_RISK:
				case SceneType.SCENE_ENDLESSABYSS:
				case SceneType.SKYCITY_FIGHTING:
				case SceneType.SCENE_PROF_TRIALS:
				case SceneType.SCENE_GPR:
				case SceneType.SCENE_RESWAR_PVP:
				case SceneType.SCENE_RESWAR_PVE:
				case SceneType.SCENE_GUILD_CAMP:
				case SceneType.SCENE_AIRSHIP:
				case SceneType.SCENE_WEEK_NEST:
				case SceneType.SCENE_HORSE_RACE:
				case SceneType.SCENE_HEROBATTLE:
				case SceneType.SCENE_INVFIGHT:
				case SceneType.SCENE_CASTLE_WAIT:
				case SceneType.SCENE_CASTLE_FIGHT:
				case SceneType.SCENE_LEAGUE_BATTLE:
				case SceneType.SCENE_ACTIVITY_ONE:
				case SceneType.SCENE_ACTIVITY_TWO:
				case SceneType.SCENE_ACTIVITY_THREE:
				case SceneType.SCENE_ABYSS_PARTY:
				case SceneType.SCENE_CUSTOMPK:
				case SceneType.SCENE_PKTWO:
				case SceneType.SCENE_MOBA:
				case SceneType.SCENE_WEEKEND4V4_MONSTERFIGHT:
				case SceneType.SCENE_WEEKEND4V4_GHOSTACTION:
				case SceneType.SCENE_WEEKEND4V4_LIVECHALLENGE:
				case SceneType.SCENE_WEEKEND4V4_CRAZYBOMB:
				case SceneType.SCENE_WEEKEND4V4_HORSERACING:
				case SceneType.SCENE_CUSTOMPKTWO:
				case SceneType.SCENE_WEEKEND4V4_DUCK:
				case SceneType.SCENE_BIGMELEE_FIGHT:
				case SceneType.SCENE_CALLBACK:
				case SceneType.SCENE_BIOHELL:
				case SceneType.SCENE_DUCK:
				case SceneType.SCENE_COUPLE:
				case SceneType.SCENE_BATTLEFIELD_FIGHT:
				case SceneType.SCENE_COMPETEDRAGON:
				case SceneType.SCENE_SURVIVE:
				case SceneType.SCENE_GCF:
				case SceneType.SCENE_GUILD_WILD_HUNT:
				case SceneType.SCENE_AWAKE:
					XSingleton<XGame>.singleton.SwitchTo(EXStage.World, sceneID);
					goto IL_336;
				case SceneType.SCENE_GUILD_HALL:
				case SceneType.SCENE_FAMILYGARDEN:
				case SceneType.SKYCITY_WAITING:
				case SceneType.SCENE_HORSE:
				case SceneType.SCENE_BIGMELEE_READY:
				case SceneType.SCENE_WEDDING:
				case SceneType.SCENE_BATTLEFIELD_READY:
				case SceneType.SCENE_LEISURE:
					XSingleton<XGame>.singleton.SwitchTo(EXStage.Hall, sceneID);
					goto IL_336;
				case SceneType.SCENE_RIFT:
				{
					//zcg 
// 					XRiftDocument specificDocument2 = XDocuments.GetSpecificDocument<XRiftDocument>(XRiftDocument.uuID);
// 					bool flag3 = specificDocument2 != null;
// 					if (flag3)
// 					{
// 						specificDocument2.stop_timer = false;
// 					}
					XSingleton<XGame>.singleton.SwitchTo(EXStage.World, sceneID);
					goto IL_336;
				}
// 				default:
//                 {
// 
//                 }
			}
			XSingleton<XDebug>.singleton.AddErrorLog("can't process enter scene type: ", sceneType.ToString(), null, null, null, null);
			IL_336:
			XSingleton<XLevelDoodadMgr>.singleton.CacheDoodad(config.doodads);
		}

		// Token: 0x0600C92B RID: 51499 RVA: 0x002D19D8 File Offset: 0x002CFBD8
		public void SceneEnterTo(bool fromserver = true)
		{
			this.SceneEnterTo(this._scene_cfg, fromserver);
			this._scene_cfg = null;
		}

		// Token: 0x0600C92C RID: 51500 RVA: 0x002D19F0 File Offset: 0x002CFBF0
		public void LoadSceneAsync(uint sceneid, EXStage eStage, bool prograss, bool transfer)
		{
			this._scene_file = XSingleton<XSceneMgr>.singleton.GetUnitySceneFile(sceneid);
			//bool flag = !string.IsNullOrEmpty(this._scene_file);
			if (!string.IsNullOrEmpty(this._scene_file))
			{
				this._bSceneEntered = false;
				this.bSceneServerReady = false;
				this.bSceneLoadedRpcSend = false;
				XSingleton<XEventMgr>.singleton.Clear();
				XEquipDocument.CurrentVisibleRole = 0;
				XDummy.visibleDummyCount = 0;
				Shader.SetGlobalVector("uirim", new Vector4(1f, 1f, 1f, 0f));
				if (transfer)
				{
					this._transfer.TransferScene(sceneid);
				}
				else
				{
					this._loader.LoadScene(this._scene_file, eStage, prograss, sceneid, this._scene_id);
				}
			}
			else
			{
				XSingleton<XDebug>.singleton.AddErrorLog("No scene file found with id ", sceneid.ToString(), null, null, null, null);
			}
		}

		// Token: 0x0600C92D RID: 51501 RVA: 0x002D1AC8 File Offset: 0x002CFCC8
		public void OnSceneBeginLoad(uint sceneid)
		{
			this._bStarted = false;
			this._scene_id = sceneid;
			XFileLog.SceneID = sceneid;
			this._scene_type = XSingleton<XSceneMgr>.singleton.GetSceneType(this._scene_id);
			this._scene_data = XSingleton<XSceneMgr>.singleton.GetSceneData(this._scene_id);
			XSingleton<XGame>.singleton.SyncModeValue = this._next_sync_mode;
			this._bIsSpectator = this._next_is_spectator;
			//bool flag = this._scene_type != SceneType.SCENE_HALL;
			if (this._scene_type != SceneType.SCENE_HALL)
			{
				XQualitySetting.EnterScene();
			}
			else
			{
				XQualitySetting.EnterHall();
			}
			this.IsViewGridScene = XSingleton<XGlobalConfig>.singleton.ViewGridScene.Contains(XFastEnumIntEqualityComparer<SceneType>.ToInt(this._scene_type));
		}

		// Token: 0x0600C92E RID: 51502 RVA: 0x002D1B76 File Offset: 0x002CFD76
		public void OnSceneLoaded(uint sceneid)
		{
			this._next_sync_mode = 0;
			this._next_is_spectator = false;
			XSingleton<XSkillFactory>.singleton.OnSceneLoaded();
			XSingleton<XLevelSpawnMgr>.singleton.OnSceneLoaded(sceneid);
			XFightGroupDocument.OnSceneLoaded();
		}

		// Token: 0x0600C92F RID: 51503 RVA: 0x002D1BA4 File Offset: 0x002CFDA4
		public void OnEnterScene(uint sceneid, bool transfer)
		{
			this._story_dirver = XSingleton<XEntityMgr>.singleton.Player;
			XSingleton<XStageProgress>.singleton.OnEnterScene();
			XSingleton<XPostEffectMgr>.singleton.OnEnterScene(sceneid);
			XQualitySetting.PostSetting();
		}

		// Token: 0x0600C930 RID: 51504 RVA: 0x002D1BD4 File Offset: 0x002CFDD4
		public void TriggerScene()
		{
			this._bSceneEntered = true;
			XSingleton<XLevelSpawnMgr>.singleton.CreateRobot(this._scene_id);
			string sceneConfigFile = XSingleton<XSceneMgr>.singleton.GetSceneConfigFile(this._scene_id);
			if (sceneConfigFile.Length != 0)
			{
				XSingleton<XLevelSpawnMgr>.singleton.InitGlobalAI(this._scene_id);
			}
		}

		// Token: 0x0600C931 RID: 51505 RVA: 0x002D1C2C File Offset: 0x002CFE2C
		public void OnSceneStarted()
		{
			for (int i = 0; i < XSingleton<XGame>.singleton.Doc.Components.Count; i++)
			{
				(XSingleton<XGame>.singleton.Doc.Components[i] as XDocComponent).OnSceneStarted();
			}
		}

		// Token: 0x0600C932 RID: 51506 RVA: 0x002D1C80 File Offset: 0x002CFE80
		public void OnLeaveScene(bool transfer)
		{
			this._story_dirver = null;
			this._bStarted = false;
			XSingleton<XShell>.singleton.TimeMagicBack();
			XSingleton<XTutorialMgr>.singleton.OnLeaveScene();
			XSingleton<XCutScene>.singleton.OnLeaveScene();
			XSingleton<XAudioMgr>.singleton.OnLeaveScene();
			XSingleton<XGameSysMgr>.singleton.OnLeaveScene(transfer);
			this._camera.Uninitilize();
			XSingleton<XFxMgr>.singleton.OnLeaveScene();
			XSingleton<XTimerMgr>.singleton.KillTimerAll();
			XSingleton<XLevelSpawnMgr>.singleton.UnInitGlobalAI();
			XHUDComponent.ResetCurrentCount();
			if (!transfer)
			{
				XSingleton<XCustomShadowMgr>.singleton.Clear();
			}
			ShadowMapInfo.ClearShadowRes();
			XSyncDebug.OnLeaveScene();
		}

		// Token: 0x0600C933 RID: 51507 RVA: 0x002D1D28 File Offset: 0x002CFF28
		public void PreUpdate(float fDeltaT)
		{
			if (this._bSceneEntered)
			{
				XSingleton<XLevelScriptMgr>.singleton.Update();
				if (XSingleton<XEntityMgr>.singleton.Player != null)
				{
					XSingleton<XEntityMgr>.singleton.Player.PreUpdate();
				}
			}
		}

		// Token: 0x0600C934 RID: 51508 RVA: 0x002D1D70 File Offset: 0x002CFF70
		public void Update(float fDeltaT)
		{
			if (this._bSceneEntered)
			{
				XSingleton<XBulletMgr>.singleton.Update(fDeltaT);
				XSingleton<XEntityMgr>.singleton.Update(fDeltaT);
				XSingleton<XLevelFinishMgr>.singleton.Update(fDeltaT);
				XSingleton<XLevelDoodadMgr>.singleton.Update();
				this._camera.Update(fDeltaT);
				XSingleton<XLevelStatistics>.singleton.Update();
				if (!XSingleton<XGame>.singleton.SyncMode)
				{
					XSingleton<XLevelSpawnMgr>.singleton.Update(fDeltaT);
				}
				if (XSingleton<XTutorialMgr>.singleton.NeedTutorail)
				{
					XSingleton<XTutorialMgr>.singleton.Update();
				}
			}
		}

		// Token: 0x0600C935 RID: 51509 RVA: 0x002D1E0C File Offset: 0x002D000C
		public void PostUpdate(float fDeltaT)
		{
			if (this._bSceneEntered)
			{
				this._camera.PostUpdate(fDeltaT);
				XSingleton<XEntityMgr>.singleton.PostUpdate(fDeltaT);
				XSingleton<XFxMgr>.singleton.PostUpdate();
				XQualitySetting.Update();
			}
		}

		// Token: 0x0600C936 RID: 51510 RVA: 0x002D1E50 File Offset: 0x002D0050
		public void FixedUpdate()
		{
			if (this._bSceneEntered)
			{
				XSingleton<XEntityMgr>.singleton.FixedUpdate();
				this._camera.FixedUpdate();
			}
		}

		// Token: 0x0600C937 RID: 51511 RVA: 0x002D1E84 File Offset: 0x002D0084
		public bool CheckDynamicBlock(Vector3 from, Vector3 to)
		{
			List<XLevelInfo> levelScriptInfos = XSingleton<XLevelScriptMgr>.singleton.GetLevelScriptInfos();
			for (int i = 0; i < levelScriptInfos.Count; i++)
			{
				if (levelScriptInfos[i].enable)
				{
					float num = levelScriptInfos[i].width / 2f;
					Vector3 vector = new Vector3(levelScriptInfos[i].x, 0f, levelScriptInfos[i].z);
					Vector3 vector2 = XSingleton<XCommon>.singleton.HorizontalRotateVetor3(XSingleton<XCommon>.singleton.FloatToAngle(levelScriptInfos[i].face), 90f, true);
					if (XSingleton<XCommon>.singleton.IsLineSegmentCross(from, to, vector + num * vector2, vector - num * vector2))
					{
						if (levelScriptInfos[i].height > from.y)
						{
							return false;
						}
					}
				}
			}
			return true;
		}

		// Token: 0x0600C938 RID: 51512 RVA: 0x002D1F88 File Offset: 0x002D0188
		public void ReqLeaveScene()
		{
			XStaticSecurityStatistics.OnEnd();
			PtcC2G_LeaveSceneReq proto = new PtcC2G_LeaveSceneReq();
			XSingleton<XClientNetwork>.singleton.Send(proto);
		}

		// Token: 0x0600C939 RID: 51513 RVA: 0x002D1FB0 File Offset: 0x002D01B0
		public void RefreshScenMustTransform()
		{
			this.m_IsMustTransform = false;
			List<int> list = ListPool<int>.Get();
			XSingleton<XGlobalConfig>.singleton.GetIntList("TransformSceneID", list);
			for (int i = 0; i < list.Count; i++)
			{
				if ((ulong)this._scene_id == (ulong)((long)list[i]))
				{
					this.m_IsMustTransform = true;
					break;
				}
			}
			ListPool<int>.Release(list);
		}

		// Token: 0x040058D8 RID: 22744
		private XSceneLoader _loader = null;

		// Token: 0x040058D9 RID: 22745
		private XSceneTransfer _transfer = null;

		// Token: 0x040058DA RID: 22746
		private int _next_sync_mode = 0;

		// Token: 0x040058DB RID: 22747
		private bool _next_is_spectator = false;

		// Token: 0x040058DC RID: 22748
		private string _scene_file = null;

		// Token: 0x040058DD RID: 22749
		private uint _scene_id = 0U;

		// Token: 0x040058DE RID: 22750
		private ErrorCode _error = ErrorCode.ERR_SUCCESS;

		// Token: 0x040058DF RID: 22751
		private string _error_addtional = null;

		// Token: 0x040058E0 RID: 22752
		private SceneCfg _scene_cfg = null;

		// Token: 0x040058E1 RID: 22753
		public SceneType _scene_type = SceneType.SCENE_LOGIN;

		// Token: 0x040058E2 RID: 22754
		private SceneTable.RowData _scene_data = null;

		// Token: 0x040058E3 RID: 22755
		private XEntity _story_dirver = null;

		// Token: 0x040058E4 RID: 22756
		private bool _bSceneEntered = false;

		// Token: 0x040058E5 RID: 22757
		private bool _bIsSpectator = false;

		// Token: 0x040058E6 RID: 22758
		private bool _bStarted = false;

		// Token: 0x040058E7 RID: 22759
		public bool bSceneServerReady = false;

		// Token: 0x040058E8 RID: 22760
		public bool bSceneLoadedRpcSend = false;

		// Token: 0x040058E9 RID: 22761
		private Terrain _terrain = null;

		// Token: 0x040058EB RID: 22763
		public Vector3 BattleTargetPoint;

		// Token: 0x040058EC RID: 22764
		public Vector3 NestTargetPoint;

		// Token: 0x040058ED RID: 22765
		private bool m_IsMustTransform = false;

		// Token: 0x040058EE RID: 22766
		private XCameraEx _camera = new XCameraEx();
	}
}
